﻿using System.Data;

namespace QuizzService.Database
{
    public partial class QuizzMeEntities
    {
        private static readonly QuizzMeEntities Instance = new QuizzMeEntities();

        /// <summary>
        /// Get the QuizzMeIntities unique instance. The connection is (re)open if needed.
        /// </summary>
        public static QuizzMeEntities Get
        {
            get
            {
                if (Instance.Connection.State != ConnectionState.Open)
                {
                    Instance.Connection.Open();
                }

                return Instance;
            }
        }
    }
}